﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using rock.UI.common;
 
 

namespace rock.UI.report
{
    public partial class UserControlYajingReport : UserControl
    {
        int XiaoQuSeqid = -1;
        int DongSeqid = -1;
        int ContranctStatus = -1;
       public UserControlYajingReport()
        {
           InitializeComponent();
           this.userControlLeftTree1.selectedTreeinfo = selectedTreeinfo;


       
          
        }

       private void UserControlYajingReport_Load(object sender, EventArgs e)
       {
           this.Dock = DockStyle.Fill;
           this.reportViewer1.LocalReport.ReportEmbeddedResource = "rock.UI.report.YajingReport.rdlc";

           refreshDate();
       }

       private void selectedTreeinfo(TreeInfo treeinfo)
       {
           if (treeinfo.NodeType == 0)
           {
               this.XiaoQuSeqid = -1;
               this.DongSeqid = -1;
           }
           else if (treeinfo.NodeType == 1)
           {
               this.XiaoQuSeqid = treeinfo.Id;
               this.DongSeqid = -1;
           }
           else if (treeinfo.NodeType == 2)
           {
               this.XiaoQuSeqid = -1;
               this.DongSeqid = treeinfo.Id;
           }

         this.refreshDate();
       }

       public void refreshDate() {
           this.vIEW_REPORT_YAJINGTableAdapter = new rock.dataset.RentalHousingManagerDataSetTableAdapters.VIEW_REPORT_YAJINGTableAdapter();
          // this.vIEW_REPORT_YAJINGTableAdapter.Fill(this.rentalHousingManagerDataSet.VIEW_REPORT_YAJING);

           this.vIEW_REPORT_YAJINGTableAdapter.FillBy(this.rentalHousingManagerDataSet.VIEW_REPORT_YAJING, this.XiaoQuSeqid, this.DongSeqid, 1);
           this.reportViewer1.RefreshReport();

            
       }

        

        
    }
}
